<template>
    <view class="page">
        <view class="role">
            <image :src="resume.avatar_url" mode="" class="photo"></image>
            <view class="roleInfo">
                <view class="name lgTitle" @tap="_toView('login/step1')">
                    <text>{{ resume.name }}</text>
                    <image src="../../../static/imgs/mine/edit.png" mode=""></image>
                </view>

                <view class="infos lgrey">
                    <text>{{ resume.exp }}年经验</text>
                    <text>{{ resume.edu }}</text>
                    <text>{{ resume.age }}岁</text>
                </view>
            </view>
        </view>

        <!-- 个人优势 -->
        <view class="itemList ">
            <view class="editItem" @click="_toView('login/step2')">
                <image src="../../../static/imgs/mine/edit.png" mode="" class="edit"></image>
                <view class="edit_type smTitle">
                    <image src="../../../static/imgs/mine/smLogo.png" mode=""></image>
                    个人优势
                </view>

                <view class="textDetail md8Text" style="white-space: pre-line;">{{resume.intro}}</view>
            </view>

            <!-- 求职希望 -->

            <view class="editItem" @tap="_toView('login/step3')">
                <view class="edit_type smTitle" style="justify-content: space-between;">
                    <view style="display: flex;">
                        <image src="../../../static/imgs/mine/smLogo.png" mode=""></image>
                        求职期望
                    </view>

                    <image src="../../../static/imgs/mine/edit.png" mode="" style="float: right;">
                    </image>
                </view>
                <view class="industry md2Title" v-for="(item,index) in resume.positions" :key="index">
                    <view class="left">
                        <view class="induName">
                            <text>{{item.position}}</text>
                            <text>{{item.salary_min}}-{{item.salary_max}}K</text>
                        </view>
                        <view class="md6Text mgrey">{{resume.city}}{{resume.dist}} {{item.qzlx}}</view>
                    </view>
                    <!-- <view class="right">
                        <image src="../../../static/imgs/right.png" mode="" class="edit"></image>
                    </view> -->
                </view>
            </view>

            <!-- 工作经历 -->

            <view class="editItem">
                <view class="edit_type smTitle" style="justify-content: space-between;">
                    <view style="display: flex;">
                        <image src="../../../static/imgs/mine/smLogo.png" mode=""></image>
                        工作经历
                    </view>


                    <image src="../../../static/imgs/mine/add.png" mode="" style="float: right;" @tap="_toView('login/step4')">
                    </image>
                </view>
                <block v-for="(item,index) in resume.workData" :key="index">
                    <view class="industry md2Title" @click="editWork(index);">
                        <view class="left">
                            <view class="induName">
                                <text class="md2Title">{{item.name}}</text>
                                <text class="md2Text mgrey date">{{item.start}}~{{item.end}}</text>
                            </view>
                            <!-- <view class="md6Text mgrey">合肥 行业不限</view> -->
                        </view>
                        <view class="right">
                            <image src="../../../static/imgs/right.png" mode="" class="edit"></image>
                        </view>
                    </view>
                    
                    <view class="part md6Text partment">
                        {{item.position}}
                    </view>
                    
                    <view class="contentWords md8Text mgrey" style="white-space: pre-line;">{{item.content}}</view>
                    <!-- <view class="tags mdText Han">
                        <view class="tag" v-for="tag in tagList">
                            {{tag}}
                        </view>
                    </view> -->
                </block>
            </view>


            <!-- 教育经历 -->
            <view class="editItem">
                <view class="edit_type smTitle" style="justify-content: space-between;">
                    <view style="display: flex;">
                        <image src="../../../static/imgs/mine/smLogo.png" mode=""></image>
                        教育经历
                    </view>


                    <image src="../../../static/imgs/mine/add.png" mode="" style="float: right;" @tap="_toView('login/step5')">
                    </image>


                </view>

                <view class="industry md2Title" v-for="(item,index) in resume.eduData" :key="index" @click="editEdu(index);">
                    <view class="left">
                        <view class="induName">
                            <text class="md2Title">{{item.name}}</text>
                            <text class="md2Text mgrey date">{{item.start}}-{{item.end}}</text>
                        </view>
                        <view class="md6Text mgrey">{{item.edu}}·{{item.major}}</view>
                    </view>

                    <view class="right">
                        <image src="../../../static/imgs/right.png" mode="" class="edit"></image>
                    </view>
                </view>

            </view>
        </view>

    </view>
</template>

<script>
    export default {
        data() {
            return {
                resume: {}
            };
        },
        onShow() {
            this.resume = uni.getStorageSync('resume') || {};
        },
        methods: {
            editWork(index) {
                uni.setStorageSync('edit_work_index', index);
                this._toView('login/step4');
            },
            editEdu(index) {
                uni.setStorageSync('edit_edu_index', index);
                this._toView('login/step5');
            }
        }
    };
</script>

<style scoped lang="less">
    .page {
        width: 100%;
        background-color: #ffffff;

        .role {
            padding: 45upx 40upx;
            display: flex;
            border-bottom: 2upx solid #e5e5e5;

            .photo {
                width: 120rpx;
                height: 120rpx;
                border-radius: 50%;
            }

            .roleInfo {
                margin-left: 33upx;

                .name {
                    image {
                        width: 30upx;
                        height: 30upx;
                        margin-left: 20upx;
                    }

                    padding-bottom: 15upx;
                    padding-top: 20upx;
                }

                .infos {
                    text {
                        padding-right: 10upx;
                    }
                }
            }
        }

        .editItem {
            padding-bottom: 46upx;
            padding-top: 32upx;
            border-bottom: 2upx solid #e5e5e5;
            position: relative;

            .edit {
                position: absolute;
                right: 0;
                width: 30upx;
                height: 28upx;
            }

            .edit_type {
                width: 100%;
                display: flex;

                image {
                    width: 32upx;
                    height: 32upx;
                }
            }
        }

        .industry {
            margin-top: 40upx;
            display: flex;
            justify-content: space-between;

            .left {
                .induName {
                    padding-bottom: 22upx;

                    text {
                        padding-right: 15upx;
                        font-weight: bold;
                    }
                }
            }

            .right {
                image {
                    width: 48upx;
                    height: 48upx;
                }
            }
        }
    }

    .itemList {
        width: 100%;
        padding: 0 32upx;
        padding-bottom: 116upx;
    }

    .textDetail {
        margin-top: 36upx;
        line-height: 44upx;
    }

    .date {
        padding-left: 40upx;
    }

    .part {
        padding-top: 20upx;
    }

    .contentWords {
        padding-top: 20upx;
    }

    .tags {
        display: flex;
        margin-top: 24upx;

        .tag {
            // width: 104upx;
            padding: 0 10upx;
            height: 42upx;
            line-height: 42upx;
            text-align: center;
            background-color: #F3FAFF;
            margin-right: 20upx;
        }
    }
</style>
